package wangxiaotao.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.ServletRequestUtils;
import wangxiaotao.service.*;
import wangxiaotao.tools.MinioTool;

import javax.servlet.http.HttpServletRequest;

public class BaseController {
    @Autowired
    HttpServletRequest request;

    @Autowired
    CommonService commonService;

    @Autowired
    AdminService adminService;

    @Autowired
    RoomService roomService;

    @Autowired
    RoomTypeService roomTypeService;

    @Autowired
    UserService userService;

    @Autowired
    OrderService orderService;

    @Autowired
    RoleService roleService;

    @Autowired
    UserRoleRelService userRoleRelService;

    @Autowired
    RolePermissionRelService rolePermissionRelService;

    @Autowired
    PermissionService permissionService;

    @Autowired
    LogServer logServer;

    @Autowired
    ShowService showService;

    @Autowired
    MinioTool minioTool;

    /**
     * 分页
     * @return
     */
    public  Page getPage(){
        int current = ServletRequestUtils.getIntParameter(request, "current", 1);
        int size = ServletRequestUtils.getIntParameter(request, "size", 10);
        return new Page(current,size);
    }
}
